import request from '@/utils/request'


/**
 * bu资讯
 */
export function page(query) {
  return request({
    url: '/api/admin/bu/queryByPage',
    method: 'get',
    params: query
  })
}

export function delList(list) {
  return request({
    url: '/api/admin/bu/deleteList',
    method: 'delete',
    data: list
  })
}

export function modify(list) {
  return request({
    url: '/api/admin/bu/savaListBu',
    method: 'post',
    data: list
  })
}

// 新增一条数据
export function insertOne(bu) {
  return request({
    url: '/api/admin/bu/insertOne',
    method: 'post',
    data: bu
  })
}

// 不分页查询
export function all() {
  return request({
    url: '/api/admin/bu/all',
    method: 'get'
  })
}


// bu和bg连动数据
export function selectBuAndBg() {
  return request({
    url: '/api/admin/bu/selectBuAndBg',
    method: 'get'
  })
}

// 查询bu
export function selectBu() {
  return request({
    url: '/api/admin/bu/selectBu',
    method: 'get'
  })
}

// 查询bu
export function selectBuDataPermissions() {
  return request({
    url: '/api/admin/bu/selectBuDataPermissions',
    method: 'get'
  })
}

// 查询bu data
export function selectBuData() {
  return request({
    url: '/api/admin/bu/selectBuData',
    method: 'get'
  })
}


// 查询bg
export function selectBg() {
  return request({
    url: '/api/admin/bu/selectBg',
    method: 'get'
  })
}

// GET /group/list
export function getUserList(query) {
  return request({
    url: '/api/admin/group/list',
    method: 'get',
    params: query
  })
}

export function listbgAndbu(query) {
  return request({
    url: '/api/admin/bu/ListbgAndbu',
    method: 'get',
    params: query
  })
}


// 通过bu名称查询bu信息
export function getBuInfo(query) {
  return request({
    url: '/api/admin/bu/getBuInfo',
    method: 'get',
    params: query
  })
}

export function getBuByListBg(query) {
  return request({
    url: '/api/admin/bu/getBuByListBg',
    method: 'get',
    params: query
  })
}

export function getBgByListBu(query) {
  return request({
    url: '/api/admin/bu/getBgByListBu',
    method: 'get',
    params: query
  })
}

export function getDeptByBuAndCountry(query) {
  return request({
    url: '/api/admin/bu/getDeptByBuAndCountry',
    method: 'post',
    data: query
  })
}



